package com.zbkj.common.model.shop;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 团购店铺表
 */
@Slf4j
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("eb_group_buy_shop")
@ApiModel(value = "团购店铺", description = "团购店铺信息表")
public class EbGroupBuyShop implements Serializable {

    private static final long serialVersionUID = 6014850668891905449L;
    @ApiModelProperty(value = "店铺ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "关联用户ID")
    private Long userId;
    @ApiModelProperty(value = "商户id")
    private Integer merId;
    private String merName;

    @ApiModelProperty(value = "店铺名称")
    private String shopName;

    @ApiModelProperty(value = "店铺封面URL")
    private String shopUrl;

    @ApiModelProperty(value = "行业分类ID,多个逗号拼接")
    private String industryIds;

    @ApiModelProperty(value = "主营类目ID,多个逗号拼接")
    private String mainCategoryIds;
    @ApiModelProperty(value = "三级类目ID,多个逗号拼接")
    private String threeLevelIndustryIds;

    @ApiModelProperty(value = "联系人名称")
    private String contactName;

    @ApiModelProperty(value = "联系电话")
    private String contactPhone;

    @ApiModelProperty(value = "联系邮箱")
    private String contactEmail;

    @ApiModelProperty(value = "省份编码")
    private String provinceCode;

    @ApiModelProperty(value = "省份名称")
    private String provinceName;

    @ApiModelProperty(value = "城市编码")
    private String cityCode;

    @ApiModelProperty(value = "城市名称")
    private String cityName;

    @ApiModelProperty(value = "区编码")
    private String districtCode;

    @ApiModelProperty(value = "区名称")
    private String districtName;

    @ApiModelProperty(value = "详细地址(街道/门牌号)")
    private String addressDetail;

    @ApiModelProperty(value = "自定义搜索经度")
    private String longitude;

    @ApiModelProperty(value = "自定义搜索纬度")
    private String latitude;

    @ApiModelProperty(value = "营业状态:1-营业中,2-装修中,3-停业")
    private Integer businessStatus;

    @ApiModelProperty(value = "保障服务：0随时退,1过期退,2免预约(多个服务逗号拼接)")
    private String guaranteeServices;

    @ApiModelProperty(value = "店铺banner图URL(多个逗号拼接)")
    private String shopBanners;

    @ApiModelProperty(value = "店铺图片URL(多个逗号拼接)")
    private String shopImages;

    @ApiModelProperty(value = "店铺描述")
    private String description;

    @ApiModelProperty(value = "审核状态:0-待审核,1-已通过,2-已拒绝")
    private Integer status;

    @ApiModelProperty(value = "入驻时间")
    private Date registerTime;
    @ApiModelProperty(value = "拒绝原因")
    private String remarks;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public boolean areEbGroupBuyShopsEqual(EbGroupBuyShop shop) {
        if (this == shop) return true;
        if (shop == null) return false;
        if (!Objects.equals(this.getShopUrl(), shop.getShopUrl())) {
            log.info("shopUrl数据不同: 当前值=" + this.getShopUrl() + ", 比较值=" + shop.getShopUrl());
            return false;
        }

        if (!Objects.equals(this.getShopName(), shop.getShopName())) {
            log.info("shopName数据不同: 当前值=" + this.getShopName() + ", 比较值=" + shop.getShopName());
            return false;
        }

        if (!Objects.equals(this.getIndustryIds(), shop.getIndustryIds())) {
            log.info("industryIds数据不同: 当前值=" + this.getIndustryIds() + ", 比较值=" + shop.getIndustryIds());
            return false;
        }

        if (!Objects.equals(this.getMainCategoryIds(), shop.getMainCategoryIds())) {
            log.info("mainCategoryIds数据不同: 当前值=" + this.getMainCategoryIds() + ", 比较值=" + shop.getMainCategoryIds());
            return false;
        }

        if (!Objects.equals(this.getContactName(), shop.getContactName())) {
            log.info("contactName数据不同: 当前值=" + this.getContactName() + ", 比较值=" + shop.getContactName());
            return false;
        }

        if (!Objects.equals(this.getContactPhone(), shop.getContactPhone())) {
            log.info("contactPhone数据不同: 当前值=" + this.getContactPhone() + ", 比较值=" + shop.getContactPhone());
            return false;
        }

        if (!Objects.equals(this.getContactEmail(), shop.getContactEmail())) {
            log.info("contactEmail数据不同: 当前值=" + this.getContactEmail() + ", 比较值=" + shop.getContactEmail());
            return false;
        }

        if (!Objects.equals(this.getProvinceCode(), shop.getProvinceCode())) {
            log.info("provinceCode数据不同: 当前值=" + this.getProvinceCode() + ", 比较值=" + shop.getProvinceCode());
            return false;
        }

        if (!Objects.equals(this.getProvinceName(), shop.getProvinceName())) {
            log.info("provinceName数据不同: 当前值=" + this.getProvinceName() + ", 比较值=" + shop.getProvinceName());
            return false;
        }

        if (!Objects.equals(this.getCityCode(), shop.getCityCode())) {
            log.info("cityCode数据不同: 当前值=" + this.getCityCode() + ", 比较值=" + shop.getCityCode());
            return false;
        }

        if (!Objects.equals(this.getCityName(), shop.getCityName())) {
            log.info("cityName数据不同: 当前值=" + this.getCityName() + ", 比较值=" + shop.getCityName());
            return false;
        }

        if (!Objects.equals(this.getDistrictCode(), shop.getDistrictCode())) {
            log.info("districtCode数据不同: 当前值=" + this.getDistrictCode() + ", 比较值=" + shop.getDistrictCode());
            return false;
        }

        if (!Objects.equals(this.getDistrictName(), shop.getDistrictName())) {
            log.info("districtName数据不同: 当前值=" + this.getDistrictName() + ", 比较值=" + shop.getDistrictName());
            return false;
        }

        if (!Objects.equals(this.getAddressDetail(), shop.getAddressDetail())) {
            log.info("addressDetail数据不同: 当前值=" + this.getAddressDetail() + ", 比较值=" + shop.getAddressDetail());
            return false;
        }

        if (!Objects.equals(this.getLongitude(), shop.getLongitude())) {
            log.info("longitude数据不同: 当前值=" + this.getLongitude() + ", 比较值=" + shop.getLongitude());
            return false;
        }

        if (!Objects.equals(this.getLatitude(), shop.getLatitude())) {
            log.info("latitude数据不同: 当前值=" + this.getLatitude() + ", 比较值=" + shop.getLatitude());
            return false;
        }

        if (!Objects.equals(this.getGuaranteeServices(), shop.getGuaranteeServices())) {
            log.info("guaranteeServices数据不同: 当前值=" + this.getGuaranteeServices() + ", 比较值=" + shop.getGuaranteeServices());
            return false;
        }

        if (!Objects.equals(this.getShopBanners(), shop.getShopBanners())) {
            log.info("shopBanners数据不同: 当前值=" + this.getShopBanners() + ", 比较值=" + shop.getShopBanners());
            return false;
        }

        if (!Objects.equals(this.getShopImages(), shop.getShopImages())) {
            log.info("shopImages数据不同: 当前值=" + this.getShopImages() + ", 比较值=" + shop.getShopImages());
            return false;
        }

        if (!Objects.equals(this.getDescription(), shop.getDescription())) {
            log.info("description数据不同: 当前值=" + this.getDescription() + ", 比较值=" + shop.getDescription());
            return false;
        }
        return true;
    }
}
